<template>
  <div>
    <a-menu
      mode="inline"
      :open-keys="openKeys"
      style="width: 300px"
      @openChange="onOpenChange"
      theme="dark"
    >
      <a-sub-menu key="sub1">
        <span slot="title"><a-icon type="appstore" /><span title="数据中心">数据中心</span></span>
        <a-menu-item key="1" @click="go('/home/serve')"> --孵化器季度报 </a-menu-item>
        <a-menu-item key="2" @click="go('/home/activity')"> --孵化器年度报 </a-menu-item>
      </a-sub-menu>
      <a-sub-menu key="sub2">
        <span slot="title"><span title="1.1.3.众创空间创业团队和初创企业季度情况监测数据">暂无
</span></span
        >
        <a-menu-item key="5" @click="go('/home/start')">1 </a-menu-item>
        <a-menu-item key="6" @click="go('/home/new')"> 2 </a-menu-item>
        <!-- <a-sub-menu key="sub3" title="Submenu"> 二级下拉
          <a-menu-item key="7"> Option 7 </a-menu-item>
          <a-menu-item key="8"> Option 8 </a-menu-item>
        </a-sub-menu> -->
      </a-sub-menu>
      <a-sub-menu key="sub4">
        <span slot="title"><span title="1.2.0.众创空间年报">暂无</span></span>
        <a-menu-item key="9" @click="go('/home/annals')"> 1 </a-menu-item>
      </a-sub-menu>
    </a-menu>
  </div>
</template>
<script>
export default {
  data() {
    return {
      rootSubmenuKeys: ["sub1", "sub2", "sub4","sub5"],
      openKeys: ["sub1"],
    };
  },
  methods: {
    go(path) {
      // console.log(path);
      this.$router.push(path)
    },

    onOpenChange(openKeys) {
      const latestOpenKey = openKeys.find(
        (key) => this.openKeys.indexOf(key) === -1
      );
      if (this.rootSubmenuKeys.indexOf(latestOpenKey) === -1) {
        this.openKeys = openKeys;
      } else {
        this.openKeys = latestOpenKey ? [latestOpenKey] : [];
      }
    },
  },
};
</script>
